package main.dic;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;

import main.staff.CreateTypesSql;
import main.util.SqlConstants;

import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;


public class CopyOfCreateSql {

	public static FileWriter dict;
	static FileWriter del;
	
	public static void main(String[] args) {
		InputStream inp;
		try {
			inp = new FileInputStream("D:/数据字典添加申请.xlsx");
			
			Workbook wb = WorkbookFactory.create(inp);
			Sheet sheet = wb.getSheetAt(0);

			dict = new FileWriter("D:/数据字典t_ucp_staffbasicinfo.sql");
			 
			 del=new FileWriter("D:/删除.sql");
			
			 CreateTypesSql.topWrite(dict);
			 operateSheetCol(sheet,11);
			 
			 SqlConstants.topWriteEnd(dict);
			 SqlConstants.topWriteEnd(del);
			 
			dict.close();
			del.close();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			
		}
	}
	
	public static int operateSheetRow(Sheet sheet,int col){
		for(int i=0;i<sheet.getLastRowNum()+1;i++){
			Row row = sheet.getRow(i);
			//sheet.getrow
			
		}
		return col;
	}
	
	public static void operateSheetCol(Sheet sheet,int endCol){
		for(int i=0;i<endCol;i++){
			System.out.println(i+"、start*************");
			i=operateSheetRow(sheet,i);
			System.out.println(i+"、end*************");
		}
	}
	
	public static void main2(String[] args){
		System.out.println(CreateTypesSql.password("0682"));
	}
	
}
